function makeChart(url, id) {
    $.ajax({
        url: url, success: function (result) {
            var chart = AmCharts.makeChart(id, {
                type: "stock",
                "theme": "none",
                pathToImages: "http://www.amcharts.com/lib/3/images/",

                dataSets: [{
                    title: "Data set",
                    fieldMappings: [{
                        fromField: "volume",
                        toField: "volume"
                    }],
                    dataProvider: result,
                    categoryField: "date"
                }
                ],

                panels: [{

                    showCategoryAxis: false,
                    title: "Volume",
                    percentHeight: 70,

                    stockGraphs: [{
                        id: "g1",

                        valueField: "volume",
                        comparable: true,
                        compareField: "volume",
                        balloonText: "[[title]]:<b>[[volume]]</b>",
                        compareGraphBalloonText: "[[title]]:<b>[[volume]]</b>"
                    }],

                    stockLegend: {
                        periodValueTextComparing: "[[percents.volume.close]]%",
                        periodValueTextRegular: "[[volume.close]]"
                    }
                },

                    {
                        title: "Volume",
                        percentHeight: 30,
                        stockGraphs: [{
                            valueField: "volume",
                            type: "column",
                            showBalloon: false,
                            fillAlphas: 1
                        }],


                        stockLegend: {
                            periodValueTextRegular: "[[volume.close]]"
                        }
                    }
                ],

                chartScrollbarSettings: {
                    graph: "g1"
                },

                chartCursorSettings: {
                    valueBalloonsEnabled: true,
                    fullWidth: true,
                    cursorAlpha: 0.1,
                    valueLineBalloonEnabled: true,
                    valueLineEnabled: true,
                    valueLineAlpha: 0.5
                },

                periodSelector: {
                    position: "left",
                    periods: [{
                        period: "MM",
                        selected: true,
                        count: 1,
                        label: "1 month"
                    }, {
                        period: "YYYY",
                        count: 1,
                        label: "1 year"
                    }, {
                        period: "YTD",
                        label: "YTD"
                    }, {
                        period: "MAX",
                        label: "MAX"
                    }]
                },

                dataSetSelector: {
                    position: "left"
                }
            });
        }
    });
}